package feed.controller;

import config.Interceptor.PassToken;
import controller.BaseController;
import feed.entity.Feed;
import feed.service.impl.Feedserviceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import utils.CommonRetumType;

import javax.annotation.Resource;

@RestController
@RequestMapping("/feed")
public class Feedcontroller extends BaseController {
    @Resource
    Feedserviceimpl feedserviceimpl;

    @PassToken
    @GetMapping("/create")
    public CommonRetumType insert(Feed feed)
    {
        return CommonRetumType.create(feedserviceimpl.insertSelective(feed),"反馈添加成功");
    }

    @PassToken
    @GetMapping("index")
    public CommonRetumType index()
    {
        return CommonRetumType.create(feedserviceimpl.selectList(),"反馈列表查询成功");
    }


}
